import 'package:flutter/material.dart';
import 'package:flutter_deer/res/colors.dart';
import 'package:flutter_deer/widgets/dialog/supply_oil_dialog.dart';

import 'cashier_page_left.dart';
import 'cashier_page_mid.dart';
import 'cashier_page_right.dart';

///收银台主页面
class CashierPage extends StatefulWidget {
  const CashierPage({super.key});

  @override
  State<StatefulWidget> createState() {
    return CashierPageState();
  }
}

class CashierPageState extends State<CashierPage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colours.grey,
      body: Padding(
        padding: const EdgeInsets.all(4.0),
        child: Row(
          children: [
            // 左侧
            Stack(
              children: [
                Container(
                  width: 250,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(3.0),
                  ),
                  child: const CashierPageLeftOilList(),
                ),
                Positioned(
                  bottom: 16,
                  right: 16,
                  child: FloatingActionButton(
                    onPressed: () {
                      // 在这里添加点击按钮后的逻辑
                      showSupplyOilDialog(context);
                    },
                    child: const Icon(Icons.add),
                  ),
                ),
              ],
            ),
            // CashierPageLeftOilList(),
            // 中间
            Expanded(
              child: Container(
                margin: const EdgeInsets.symmetric(horizontal: 4.0),
                alignment: Alignment.topLeft,
                // decoration: BoxDecoration(
                //   color: Colors.white,
                //   borderRadius: BorderRadius.circular(4.0),
                // ),
                // child: const Text(
                //   '中间内容',
                //   style: TextStyle(fontSize: 16),
                // ),
                child: const CashierPageMid(),
              ),
            ),
            // 右侧
            Container(
              width: 250,
              // alignment: CenterRight(),
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(4.0),
              ),
              child: CashierPageRight(),
              // child: CashierPageDiscount(),
            ),
          ],
        ),
      ),
    );
  }
}
